# 定义抽象建造者接口
class Builder:
    def build_part_a(self):
        pass

    def build_part_b(self):
        pass

    def build_part_c(self):
        pass

    def get_result(self):
        pass

# 定义具体建造者
class ConcreteBuilder(Builder):
    def __init__(self):
        self.product = Product()

    def build_part_a(self):
        self.product.add_part("Part A")

    def build_part_b(self):
        self.product.add_part("Part B")

    def build_part_c(self):
        self.product.add_part("Part C")

    def get_result(self):
        return self.product

# 定义产品类
class Product:
    def __init__(self):
        self.parts = []

    def add_part(self, part):
        self.parts.append(part)

    def show(self):
        print("Product: " + ", ".join(self.parts))

# 定义导演者类
class Director:
    def __init__(self, builder):
        self.builder = builder

    def construct(self):
        self.builder.build_part_a()
        self.builder.build_part_b()
        self.builder.build_part_c()

    def get_result(self):
        return self.builder.get_result()

# 定义客户端代码
def client_code():
    builder = ConcreteBuilder()
    director = Director(builder)
    director.construct()
    product = director.get_result()
    product.show()  # 输出: Product: Part A, Part B, Part C

# 运行客户端代码
client_code()